import request from '@/utils/request';

// 查询搜索历史列表
export function listHistory(query) {
	return request({
		url: '/mall/history/list',
		method: 'post',
		data: query,
	});
}

// 查询搜索历史详细
export function getHistory(id) {
	return request({
		url: '/mall/history/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增搜索历史
export function addHistory(data) {
	return request({
		url: '/mall/history/add',
		method: 'post',
		data: data,
	});
}

// 编辑搜索历史
export function updateHistory(data) {
	return request({
		url: '/mall/history/edit',
		method: 'post',
		data: data,
	});
}

// 删除搜索历史
export function delHistory(id) {
	return request({
		url: '/mall/history/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出搜索历史
export function exportHistory(query) {
	return request({
		url: '/mall/history/export',
		method: 'post',
		params: query,
	});
}
